# -*- coding: utf-8 -*-
# @Time    : 2024/9/6 下午2:40
# @Author  : liujun
# @Email   : 2592730854@qq.com
# @File    : swipe.py
# @Software: PyCharm

class Swipe:
    def __init__(self, driver):
        self.driver=driver
        self.size=self.driver.get_window_size()
        self.width=self.size.get('width')
        self.height=self.size.get('height')

    def swipe_up(self, duration=3):
        start_x = end_x = self.width / 2
        start_y = self.height * 0.8
        end_y = self.height * 0.1
        self.driver.swipe(start_x, start_y, end_x, end_y, duration=duration * 1000)